package com.lkx.iocproject.inject;

import android.util.Log;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class EventInvocationHandler implements InvocationHandler {

    //被代理对象
    private Object obj;

    //被代理的方法
    private Method proxyMethod;

    public EventInvocationHandler(Object obj, Method proxyMethod) {
        this.obj = obj;
        this.proxyMethod = proxyMethod;
    }

    @Override
    public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
//        Log.d("lkx_debug","EventInvocationHandler invoke");
//        Log.d("lkx_debug","method ="+method);
//        Log.d("lkx_debug","proxyMethod ="+proxyMethod);
        Object o1 = proxyMethod.invoke(obj,objects);
        Log.d("lkx_debug","o1 ="+o1);
        return o1;
    }
}
